
---@class RedDotsFriendGiftHandler
RedDotsFriendGiftHandler ={};
local this = RedDotsFriendGiftHandler;

function RedDotsFriendGiftHandler.init()

    CloseEvent(Config.EventType.Fresh_FriendGiftInfo,this.update);
    ListenEvent(Config.EventType.Fresh_FriendGiftInfo,this.update);
    return this;
end

function RedDotsFriendGiftHandler.getFlag(...)
    if logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.Friend,false) then
        local flag1 = logicMgr.FriendManager.HasReward()
        local flag2 =logicMgr.FriendManager.CanOpenFriendBox()
        if flag1 or flag2 then
            return Config.RedDotsFlagState.Needful
        end
    end
    return Config.RedDotsFlagState.None;
end

function RedDotsFriendGiftHandler.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.FriendGift);
end
